package com.government.system.service.impl;

import java.util.List;
import com.government.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.government.system.mapper.LabelTypeMapper;
import com.government.system.domain.LabelType;
import com.government.system.service.ILabelTypeService;

/**
 * 标签类型Service业务层处理
 * 
 * @author system
 * @date 2023-09-06
 */
@Service
public class LabelTypeServiceImpl implements ILabelTypeService 
{
    @Autowired
    private LabelTypeMapper labelTypeMapper;

    /**
     * 查询标签类型
     * 
     * @param labelTypeId 标签类型主键
     * @return 标签类型
     */
    @Override
    public LabelType selectLabelTypeByLabelTypeId(Long labelTypeId)
    {
        return labelTypeMapper.selectLabelTypeByLabelTypeId(labelTypeId);
    }

    /**
     * 查询标签类型列表
     * 
     * @param labelType 标签类型
     * @return 标签类型
     */
    @Override
    public List<LabelType> selectLabelTypeList(LabelType labelType)
    {
        return labelTypeMapper.selectLabelTypeList(labelType);
    }

    /**
     * 新增标签类型
     * 
     * @param labelType 标签类型
     * @return 结果
     */
    @Override
    public int insertLabelType(LabelType labelType)
    {
        labelType.setCreateTime(DateUtils.getNowDate());
        return labelTypeMapper.insertLabelType(labelType);
    }

    /**
     * 修改标签类型
     * 
     * @param labelType 标签类型
     * @return 结果
     */
    @Override
    public int updateLabelType(LabelType labelType)
    {
        labelType.setUpdateTime(DateUtils.getNowDate());
        return labelTypeMapper.updateLabelType(labelType);
    }

    /**
     * 批量删除标签类型
     * 
     * @param labelTypeIds 需要删除的标签类型主键
     * @return 结果
     */
    @Override
    public int deleteLabelTypeByLabelTypeIds(Long[] labelTypeIds)
    {
        return labelTypeMapper.deleteLabelTypeByLabelTypeIds(labelTypeIds);
    }

    /**
     * 删除标签类型信息
     * 
     * @param labelTypeId 标签类型主键
     * @return 结果
     */
    @Override
    public int deleteLabelTypeByLabelTypeId(Long labelTypeId)
    {
        return labelTypeMapper.deleteLabelTypeByLabelTypeId(labelTypeId);
    }
}
